<?php
/**
 * Created by PhpStorm.
 * User: luiz
 * Date: 2019/5/18
 * Time: 20:22
 */

namespace app\api\modle;


class Order extends BaseModel
{
    protected $hidden=['update_time','delete_time','user_id'];
    protected $autoWriteTimestamp = true;
    public function getSnapItemsAttr($value)
    {
        return json_decode($value);
    }
    public function getSnapAddressAttr($value)
    {
        return json_decode($value);
    }
    public static function getSummaryByUser($uid,$page=1,$size=15)
    {
        $pagingDate = self::where('user_id','=',$uid)->order('create_time desc')->paginate($size,true,['page'=>$page]);
        return $pagingDate;

    }
}